let  {merge} =require('webpack-merge')

let  base =require('./webpack.base.js') 
let  devconfig =require('./webpack.config.dev.js') 
let  prodconfig =require('./webpack.config.prod.js') 

module.exports=(env)=>{
    console.log(env,'环境变量')
    switch(true){
        case env.development:
            return merge(base,devconfig);
        case env.production:
            return merge(base,prodconfig)
            
        default:
           return new Error('未设置环境变量')
    }
}